// 03admin/14feedback/feedbackIndex.js
var co = require("../../resource/js/common.js")
var app = getApp()
var _this, _data
Page({

   /**
    * 页面的初始数据
    */
   data: {
      IdeaList: []
   },

   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
      _this = this
      _data = this.data
      this.getIdeaList();
   },

   onShow() {
      this.getIdeaList();
   },
   //获取意见管理端口列表
   getIdeaList() {
      co.getShareApi("feedback/Femg/projectList", {
         type: 2,
         project:"jyhs"
      }, function(res) {
         if (res.code == 0) {
            _this.setData({
               IdeaList: res.data
            })
         }
      })
   },

   toFeedback(e) {
      var obj = _data.IdeaList[e.currentTarget.id]
      console.log(obj)
      wx.navigateTo({
         url: "/04jyhs/agreeAdmin/feedback?Project_Key=" + obj.Project_Key + '&Project_Name=' + obj.Project_Name
      })
   },

   addFeedback(e) {
      var obj = _data.IdeaList[e.currentTarget.id]
      wx.navigateTo({
         url: "/04jyhs/agreeAdmin/03helpFeedback/helpFeedback?From_Client=" + obj.Project_Key + '&Project_Name=' + obj.Project_Name,
      })
   }
})